﻿using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;

namespace VideoSeller.Core.Installers
{
	public class ModelsInstaller : IWindsorInstaller
	{
		public void Install(IWindsorContainer container, IConfigurationStore store)
		{
			container.Register(Classes.FromAssemblyNamed("VideoSeller.Business")
				.Pick()
				.If(Component.IsInNamespace("VideoSeller.Business.Models"))
				.WithService.Self()
				.Configure(c => c.LifestylePerWebRequest()));
		}
	}
}